<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE GADTs #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE RankNTypes #-}</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- | @since 2.2.0</span><span>
</span><span id="line-4"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Utils.IOData</span><span>
</span><span id="line-5"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="hs-comment">-- * 'IOData' &amp; 'IODataMode' type</span></span><span>
</span><span id="line-6"></span><span>      </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier">IOData</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-7"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier">IODataMode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-8"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier">KnownIODataMode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-9"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#withIOData"><span class="hs-identifier">withIOData</span></a></span><span>
</span><span id="line-10"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#null"><span class="hs-identifier">null</span></a></span><span>
</span><span id="line-11"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#hPutContents"><span class="hs-identifier">hPutContents</span></a></span><span>
</span><span id="line-12"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-13"></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.html#"><span class="hs-identifier">Data.ByteString.Lazy</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LBS</span></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span>           </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier">null</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/System.IO.html#"><span class="hs-identifier">System.IO</span></a></span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-comment">-- | Represents either textual or binary data passed via I/O functions</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- which support binary/text mode</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- @since 2.2</span><span>
</span><span id="line-23"></span><span class="hs-keyword">data</span><span> </span><span id="IOData"><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier hs-var">IOData</span></a></span></span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="IODataText"><span class="annot"><a href="Distribution.Utils.IOData.html#IODataText"><span class="hs-identifier hs-var">IODataText</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-comment">-- ^ How Text gets encoded is usually locale-dependent.</span><span>
</span><span id="line-26"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="IODataBinary"><span class="annot"><a href="Distribution.Utils.IOData.html#IODataBinary"><span class="hs-identifier hs-var">IODataBinary</span></a></span></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">LBS.ByteString</span></a></span><span>
</span><span id="line-27"></span><span>    </span><span class="hs-comment">-- ^ Raw binary which gets read/written in binary mode.</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span id="local-6989586621679616821"><span class="annot"><a href="Distribution.Utils.IOData.html#withIOData"><span class="hs-identifier hs-type">withIOData</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier hs-type">IOData</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679616823"><span class="annot"><a href="#local-6989586621679616823"><span class="hs-identifier hs-type">mode</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier hs-type">IODataMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679616823"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679616823"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679616821"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679616821"><span class="hs-identifier hs-type">r</span></a></span></span><span>
</span><span id="line-30"></span><span id="withIOData"><span class="annot"><span class="annottext">withIOData :: forall r.
IOData -&gt; (forall mode. IODataMode mode -&gt; mode -&gt; r) -&gt; r
</span><a href="Distribution.Utils.IOData.html#withIOData"><span class="hs-identifier hs-var hs-var">withIOData</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataText"><span class="hs-identifier hs-type">IODataText</span></a></span><span> </span><span id="local-6989586621679616795"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616795"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679616794"><span class="annot"><span class="annottext">forall mode. IODataMode mode -&gt; mode -&gt; r
</span><a href="#local-6989586621679616794"><span class="hs-identifier hs-var">k</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IODataMode String -&gt; String -&gt; r
forall mode. IODataMode mode -&gt; mode -&gt; r
</span><a href="#local-6989586621679616794"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">IODataMode String
</span><a href="Distribution.Utils.IOData.html#IODataModeText"><span class="hs-identifier hs-var">IODataModeText</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616795"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-31"></span><span class="annot"><a href="Distribution.Utils.IOData.html#withIOData"><span class="hs-identifier hs-var">withIOData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataBinary"><span class="hs-identifier hs-type">IODataBinary</span></a></span><span> </span><span id="local-6989586621679616792"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616792"><span class="hs-identifier hs-var">lbs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679616791"><span class="annot"><span class="annottext">forall mode. IODataMode mode -&gt; mode -&gt; r
</span><a href="#local-6989586621679616791"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IODataMode ByteString -&gt; ByteString -&gt; r
forall mode. IODataMode mode -&gt; mode -&gt; r
</span><a href="#local-6989586621679616791"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">IODataMode ByteString
</span><a href="Distribution.Utils.IOData.html#IODataModeBinary"><span class="hs-identifier hs-var">IODataModeBinary</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616792"><span class="hs-identifier hs-var">lbs</span></a></span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-comment">-- | Test whether 'IOData' is empty</span><span>
</span><span id="line-34"></span><span class="annot"><a href="Distribution.Utils.IOData.html#null"><span class="hs-identifier hs-type">null</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier hs-type">IOData</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-35"></span><span id="null"><span class="annot"><span class="annottext">null :: IOData -&gt; Bool
</span><a href="Distribution.Utils.IOData.html#null"><span class="hs-identifier hs-var hs-var">null</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataText"><span class="hs-identifier hs-type">IODataText</span></a></span><span> </span><span id="local-6989586621679616789"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616789"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">Prelude.null</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616789"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-36"></span><span class="annot"><a href="Distribution.Utils.IOData.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataBinary"><span class="hs-identifier hs-type">IODataBinary</span></a></span><span> </span><span id="local-6989586621679616788"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616788"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Bool
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#null"><span class="hs-identifier hs-var">LBS.null</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616788"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier hs-type">IOData</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-39"></span><span>    </span><span id="local-6989586621679616777"><span class="annot"><span class="annottext">rnf :: IOData -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataText"><span class="hs-identifier hs-type">IODataText</span></a></span><span> </span><span id="local-6989586621679616775"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616775"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616775"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataBinary"><span class="hs-identifier hs-type">IODataBinary</span></a></span><span> </span><span id="local-6989586621679616774"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616774"><span class="hs-identifier hs-var">lbs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616774"><span class="hs-identifier hs-var">lbs</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-comment">-- | @since 2.2</span><span>
</span><span id="line-43"></span><span class="hs-keyword">class</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679616813"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span id="KnownIODataMode"><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier hs-var">KnownIODataMode</span></a></span></span><span> </span><span id="local-6989586621679616813"><span class="annot"><a href="#local-6989586621679616813"><span class="hs-identifier hs-type">mode</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-44"></span><span>    </span><span class="hs-comment">-- | 'IOData' Wrapper for 'System.IO.hGetContents'</span><span>
</span><span id="line-45"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-46"></span><span>    </span><span class="hs-comment">-- __Note__: This operation uses lazy I/O. Use 'NFData' to force all</span><span>
</span><span id="line-47"></span><span>    </span><span class="hs-comment">-- data to be read and consequently the internal file handle to be</span><span>
</span><span id="line-48"></span><span>    </span><span class="hs-comment">-- closed.</span><span>
</span><span id="line-49"></span><span>    </span><span class="hs-comment">--</span><span>
</span><span id="line-50"></span><span>    </span><span id="hGetIODataContents"><span class="annot"><a href="Distribution.Utils.IOData.html#hGetIODataContents"><span class="hs-identifier hs-type">hGetIODataContents</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">System.IO.Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Prelude.IO</span></span><span> </span><span class="annot"><a href="#local-6989586621679616813"><span class="hs-identifier hs-type">mode</span></a></span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span>    </span><span id="toIOData"><span class="annot"><a href="Distribution.Utils.IOData.html#toIOData"><span class="hs-identifier hs-type">toIOData</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679616813"><span class="hs-identifier hs-type">mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier hs-type">IOData</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span id="iodataMode"><span class="annot"><a href="Distribution.Utils.IOData.html#iodataMode"><span class="hs-identifier hs-type">iodataMode</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier hs-type">IODataMode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679616813"><span class="hs-identifier hs-type">mode</span></a></span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="hs-comment">-- | @since 3.2</span><span>
</span><span id="line-56"></span><span class="hs-keyword">data</span><span> </span><span id="IODataMode"><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier hs-var">IODataMode</span></a></span></span><span> </span><span id="local-6989586621679616769"><span class="annot"><a href="#local-6989586621679616769"><span class="hs-identifier hs-type">mode</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-57"></span><span>    </span><span id="IODataModeText"><span class="annot"><a href="Distribution.Utils.IOData.html#IODataModeText"><span class="hs-identifier hs-var">IODataModeText</span></a></span></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier hs-type">IODataMode</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-58"></span><span>    </span><span id="IODataModeBinary"><span class="annot"><a href="Distribution.Utils.IOData.html#IODataModeBinary"><span class="hs-identifier hs-var">IODataModeBinary</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataMode"><span class="hs-identifier hs-type">IODataMode</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">LBS.ByteString</span></a></span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span id="local-6989586621679616809"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="#local-6989586621679616809"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><span class="hs-operator hs-type">~</span></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier hs-type">KnownIODataMode</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679616809"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>    </span><span id="local-6989586621679616756"><span class="annot"><span class="annottext">hGetIODataContents :: Handle -&gt; IO [a]
</span><a href="#local-6989586621679616756"><span class="hs-identifier hs-var hs-var hs-var hs-var">hGetIODataContents</span></a></span></span><span> </span><span id="local-6989586621679616755"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616755"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; Bool -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSetBinaryMode"><span class="hs-identifier hs-var">System.IO.hSetBinaryMode</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616755"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; IO String
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hGetContents"><span class="hs-identifier hs-var">System.IO.hGetContents</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616755"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span>    </span><span id="local-6989586621679616752"><span class="annot"><span class="annottext">toIOData :: [a] -&gt; IOData
</span><a href="#local-6989586621679616752"><span class="hs-identifier hs-var hs-var hs-var hs-var">toIOData</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[a] -&gt; IOData
String -&gt; IOData
</span><a href="Distribution.Utils.IOData.html#IODataText"><span class="hs-identifier hs-var">IODataText</span></a></span><span>
</span><span id="line-66"></span><span>    </span><span id="local-6989586621679616751"><span class="annot"><span class="annottext">iodataMode :: IODataMode [a]
</span><a href="#local-6989586621679616751"><span class="hs-identifier hs-var hs-var hs-var hs-var">iodataMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IODataMode [a]
IODataMode String
</span><a href="Distribution.Utils.IOData.html#IODataModeText"><span class="hs-identifier hs-var">IODataModeText</span></a></span></span><span>
</span><span id="line-67"></span><span>
</span><span id="line-68"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#KnownIODataMode"><span class="hs-identifier hs-type">KnownIODataMode</span></a></span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Lazy.Internal.html#ByteString"><span class="hs-identifier hs-type">LBS.ByteString</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-69"></span><span>    </span><span id="local-6989586621679616743"><span class="annot"><span class="annottext">hGetIODataContents :: Handle -&gt; IO ByteString
</span><a href="#local-6989586621679616743"><span class="hs-identifier hs-var hs-var hs-var hs-var">hGetIODataContents</span></a></span></span><span> </span><span id="local-6989586621679616742"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616742"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; Bool -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSetBinaryMode"><span class="hs-identifier hs-var">System.IO.hSetBinaryMode</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616742"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><span class="annottext">Handle -&gt; IO ByteString
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#hGetContents"><span class="hs-identifier hs-var">LBS.hGetContents</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616742"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span>    </span><span id="local-6989586621679616740"><span class="annot"><span class="annottext">toIOData :: ByteString -&gt; IOData
</span><a href="#local-6989586621679616740"><span class="hs-identifier hs-var hs-var hs-var hs-var">toIOData</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; IOData
</span><a href="Distribution.Utils.IOData.html#IODataBinary"><span class="hs-identifier hs-var">IODataBinary</span></a></span><span>
</span><span id="line-74"></span><span>    </span><span id="local-6989586621679616739"><span class="annot"><span class="annottext">iodataMode :: IODataMode ByteString
</span><a href="#local-6989586621679616739"><span class="hs-identifier hs-var hs-var hs-var hs-var">iodataMode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IODataMode ByteString
</span><a href="Distribution.Utils.IOData.html#IODataModeBinary"><span class="hs-identifier hs-var">IODataModeBinary</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | 'IOData' Wrapper for 'System.IO.hPutStr' and 'System.IO.hClose'</span><span>
</span><span id="line-77"></span><span class="hs-comment">--</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- This is the dual operation ot 'hGetIODataContents',</span><span>
</span><span id="line-79"></span><span class="hs-comment">-- and consequently the handle is closed with `hClose`.</span><span>
</span><span id="line-80"></span><span class="hs-comment">--</span><span>
</span><span id="line-81"></span><span class="hs-comment">-- /Note:/ this performs lazy-IO.</span><span>
</span><span id="line-82"></span><span class="hs-comment">--</span><span>
</span><span id="line-83"></span><span class="hs-comment">-- @since 2.2</span><span>
</span><span id="line-84"></span><span class="annot"><a href="Distribution.Utils.IOData.html#hPutContents"><span class="hs-identifier hs-type">hPutContents</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Handle.Types.html#Handle"><span class="hs-identifier hs-type">System.IO.Handle</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Utils.IOData.html#IOData"><span class="hs-identifier hs-type">IOData</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Prelude.IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span id="hPutContents"><span class="annot"><span class="annottext">hPutContents :: Handle -&gt; IOData -&gt; IO ()
</span><a href="Distribution.Utils.IOData.html#hPutContents"><span class="hs-identifier hs-var hs-var">hPutContents</span></a></span></span><span> </span><span id="local-6989586621679616738"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616738"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataText"><span class="hs-identifier hs-type">IODataText</span></a></span><span> </span><span id="local-6989586621679616737"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616737"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-86"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; Bool -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSetBinaryMode"><span class="hs-identifier hs-var">System.IO.hSetBinaryMode</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616738"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-87"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; String -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.Text.html#hPutStr"><span class="hs-identifier hs-var">System.IO.hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616738"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679616737"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-88"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">System.IO.hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616738"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-89"></span><span class="annot"><a href="Distribution.Utils.IOData.html#hPutContents"><span class="hs-identifier hs-var">hPutContents</span></a></span><span> </span><span id="local-6989586621679616734"><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616734"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.IOData.html#IODataBinary"><span class="hs-identifier hs-type">IODataBinary</span></a></span><span> </span><span id="local-6989586621679616733"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616733"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-90"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; Bool -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hSetBinaryMode"><span class="hs-identifier hs-var">System.IO.hSetBinaryMode</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616734"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-91"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; ByteString -&gt; IO ()
</span><a href="../../bytestring/src/Data.ByteString.Lazy.html#hPutStr"><span class="hs-identifier hs-var">LBS.hPutStr</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616734"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679616733"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-92"></span><span>    </span><span class="annot"><span class="annottext">Handle -&gt; IO ()
</span><a href="../../base/src/GHC.IO.Handle.html#hClose"><span class="hs-identifier hs-var">System.IO.hClose</span></a></span><span> </span><span class="annot"><span class="annottext">Handle
</span><a href="#local-6989586621679616734"><span class="hs-identifier hs-var">h</span></a></span><span>
</span><span id="line-93"></span></pre></body></html>